using FluentNHibernate.Mapping;
using Subfaculty.Common.Entities;

namespace Subfaculty.Infrastructure.Repositories.Mapping
{
	public class StudyAreaMapping : ClassMap<StudyArea>
	{
		public StudyAreaMapping()
		{
			Id(x => x.Id).GeneratedBy.Identity();

			Map(x => x.Code);
			Map(x => x.Name);
			Map(x => x.Profile);
			Map(x => x.Qualification);
			Map(x => x.Duration);

			HasMany(x => x.StudyPlans).Inverse().Cascade.SaveUpdate();
		}
	}
}